/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2021并保留所有权利。
 * Copyright 2021, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._6创建扩展了AbstractFactory的工厂类_基于给定的信息生成实体类的对象;

import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._1为形状创建一个接口.Shape;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._3为颜色创建一个接口.Color;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._4创建实现接口的实体类.Blue;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._4创建实现接口的实体类.Green;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._4创建实现接口的实体类.Red;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._5为Color和Shape对象创建抽象类来获取工厂.AbstractFactory;

public class ColorFactory extends AbstractFactory {
    
   @Override
   public Shape getShape(String shapeType){
      return null;
   }
   
   @Override
   public Color getColor(String color) {
      if(color == null){
         return null;
      }        
      if(color.equalsIgnoreCase("RED")){
         return new Red();
      } else if(color.equalsIgnoreCase("GREEN")){
         return new Green();
      } else if(color.equalsIgnoreCase("BLUE")){
         return new Blue();
      }
      return null;
   }
}